package com.iqik.base.alg;

import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class BaseDemo {
    int a = 0;
    int b = 0;
    public BaseDemo(int arg) {
        b = arg;
    }
    private static volatile int s = 0;
    private static final ThreadPoolExecutor async = new ThreadPoolExecutor(
            0, Integer.MAX_VALUE,
            60L, TimeUnit.SECONDS, new SynchronousQueue<>());

    public static void main(String[] args) throws InterruptedException {
//        String s = new String(new char[] {'没','人','比','我','更','懂','j','a','v','a'});
//        String si = "没人比我更懂java";
//        System.out.println(s == si);
//        System.out.println(s.intern() == "没人比我更懂java");
//        System.out.println(s == si.intern());
//        BaseDemo bd1, bd2;
//        int n, m;
//        n = 1; m = 2;
//        bd1 = new BaseDemo();
//        bd2 = new BaseDemo(n);

            for (int i = 0; i < 10000; i++) {
                async.execute(()-> s++);
            }
            Thread.sleep(1000L);
            System.out.println(s);
    }
}
